﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;

namespace chemicall
{
    public class ScreenWin : MenuScreen
    {
        int levelNum;
        public ScreenWin(int levelNum)
            : base("VOUS AVEZ GAGNE!!!!")
        {
            this.levelNum = levelNum;
            this.IsPopup = true;
            MenuItem menuEntry = new MenuItem("Ok");
            MenuItem replayEntry = new MenuItem("Rejouer");

            menuEntry.Selected += MenuEntrySelected;
            replayEntry.Selected += ReplayEntrySelected;

            MenuEntries.Add(menuEntry);
            MenuEntries.Add(replayEntry);
        }

        void MenuEntrySelected(object sender, System.EventArgs e)
        {
            this.ScreenManager.LastScreen = this;
            ScreenManager.AddScreen(new MainMenuLoaded(), PlayerIndex.One);
        }

        void ReplayEntrySelected(object sender, System.EventArgs e)
        {
            this.ScreenManager.LastScreen = this;
            ScreenManager.AddScreen(LevelManager.getInstance(), PlayerIndex.One);
            LevelManager.getInstance().LoadLevel(levelNum);
        }
    }
}
